how to check internet connection in react js